# -*- coding=utf-8 -*-
"""创建一个大战外星人的游戏"""
import pygame
import sys
from settings import Settings
from ship import Ship
import game_function as gf

def run_game():
    pygame.init()
    ai_settings = Settings()
    ai_settings.show_config()
    screen = pygame.display.set_mode((ai_settings.screen_width, ai_settings.screen_height))
    pygame.display.set_caption("大战外星人")

    ship = Ship(ai_settings, screen)
    '''初始化游戏循环主体'''
    while True:

        gf.check_events(ship)
        ship.update()
        gf.update_screen(ai_settings, screen, ship)

if __name__ == '__main__':
    run_game()